package com.myownthemepark.s3vn;

import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.AsyncCallback.DataCallback;
import org.apache.zookeeper.data.Stat;

public class S3vnWatcher implements org.apache.zookeeper.Watcher, DataCallback {
	byte data[] = null;
	@Override
	public synchronized void processResult(int rc, String path, Object ctx, byte[] data, Stat stat){
		System.out.println("S3vnWatcher: processResult: Got data: " + data);
		this.setData(data);
		this.notify();
	}
	@Override
	public synchronized void process(WatchedEvent event) {
		System.out.println("S3vnWatcher: process()");
		this.notify();
	}
	public byte[] getData(){
		return this.data;
	}
	private void setData(byte[] data){
		this.data = data;
	}
}